package com.ruoyi.provider.controller

import com.ruoyi.common.core.web.controller.BaseController
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.autoconfigure.web.ServerProperties
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RestController

/**
 *@author YanYu
 *@date 2024/9/22 14:02
 */
@RestController
class ProviderController : BaseController() {

    @Autowired
    private lateinit var serverProperties: ServerProperties

    @GetMapping("/demo")
    fun providerDemo(): String {
        Thread.sleep(15000)
        return "这是端口为${serverProperties.port}的provider-demo返回的信息"
    }

    @GetMapping("/demo-large")
    fun providerDemoLarge(): String {
        var text = ""
        for (i in 1..100) {
            text += "这是一段没有意义的话你可以试试看"
        }
        return "这是端口为${serverProperties.port}的provider-demo返回的信息<br />$text"
    }
}